#include <iostream>
#include "Sales_item.h"

int main()
{
	Sales_item book;
	Sales_item sum;

	if (std::cin >> sum){
		while(std::cin >> book) 
		{
			if(sum.same_isbn(book)) 
			{
				sum = sum + book;
			}
			else 
			{
				std::cout << sum << std::endl;
				sum = book;
			}
		}
	}
	std::cout << sum << std::endl;
		
	return 0;
}
